<?php
class ContactsModel extends Model{
    //获取联系人分类列表
	public function  getCategory($uid,$cid = 0){
		$ContactsCategory = M('ContactsCategory');
		$data=array(
			'owner_uid' => $uid,
			'parent_id' => _intval($cid) //去掉两边的空格等空字符，然后强制转换为int型
		);	
		return $ContactsCategory->where($data)->select();	
	
	}

	//获取联系人分组列表
	public function  getGroup($uid,$cid = 0){
		$ContactsGroup = M('ContactsGroup');
		$data=array(
			'owner_uid' => $uid,
			'parent_id' => _intval($cid) //去掉两边的空格等空字符，然后强制转换为int型
		);	
		return $ContactsGroup->where($data)->select();	
	
	}

}
?>